<!-- eslint-disable vue/multi-word-component-names -->
<template>
  <section class="section">
    <div class="img" @click="$router.push('/')"><img src="@/assets/头像.jpg" alt="">
      <div class="aoo"> ┗|｀O′|┛ 嗷~🍉~</div>
    </div>
    <div class="item">
      <div class="a">Ko&nbsp;</div>
      <div class="a">Ko&nbsp;</div>
      <span @click="emit('clickk')">暗藏杀坤</span>
    </div>

  </section>
</template>

<script setup lang="ts" >

const emit = defineEmits<{
  (e: 'clickk'): void
}>()
</script>

<style scoped lang="scss">
section {
  position: fixed;
  top: 0;
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999;
  background-color: rgba(255, 255, 255, .1);
  backdrop-filter: blur(50px) saturate(1.25);
  transition: 1s;

  .img {
    position: absolute;

    display: flex;
    align-items: center;
    height: 100%;

    left: 30px;

    img {
      position: relative;
      width: 50px;
      height: 50px;
      border-radius: 50%;



    }

    &:hover {
      animation: img .1s linear infinite;

    }

    .aoo {
      color: coral;
      width: 180px;
      height: 50px;
      line-height: 50px;
      font-size: 20px;

      &:hover {
        animation: img .1s linear infinite;

      }

    }
  }


}

section .item {

  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;



}

section .item .a {


  color: #fff;
  font-style: italic;
  font-weight: bold;
  width: 100%;
  font-size: 5vw;
  top: 0;
  opacity: 1;
  transform: translate(10%, 0);
  transition: top 0.5s, opacity 0.5s;
}

/* 切割文字 */
section .item .a:nth-child(1) {
  position: absolute;
  clip-path: polygon(0% 0%, 100% 0%, 100% 51%, 0% 51%);
}

section .item .a:nth-child(2) {
  position: relative;
  clip-path: polygon(0% 50%, 100% 50%, 100% 100%, 0% 100%);
}

/* 触发景深效果 */
section:hover .item {
  filter: blur(5px);
  transform: scale(0.8);
  transition: filter 0.5s, transform 0.5s;
}

/* 对应的取消景深效果*/
section .item:hover {
  filter: blur(0px);
  transform: scale(1);
  transition: filter 0.5s, transform 0.5s;
}

/* 上半部分上移并变淡 */
section .item:hover .a:nth-child(1) {
  top: -20px;
  opacity: 0.5;
  transition: top 0.5s, opacity 0.5s;
}

/* 下半部分下移并变淡 */
section .item:hover .a:nth-child(2) {
  top: 20px;
  opacity: 0.5;
  transition: top 0.5s, opacity 0.5s;
}

/* 裂开后显示的文字 */
section .item span {
  position: absolute;
  color: #fff;
  text-decoration: none !important;
  opacity: 0;
  transition: opacity 0.5s;
  cursor: pointer;

  .img {
    width: 50px;
    height: 50px;
    opacity: .8;
  }
}


section .item:hover span {
  opacity: 1;
}


@keyframes img {
  0% {
    transform: rotate(0deg);
  }

  33% {
    transform: rotate(5deg);

  }

  66% {
    transform: rotate(-5deg);

  }

  100% {
    transform: rotate(0deg);
  }


}
</style>